package View.LinearFilterTable;

import View.UserFilterDialog.UserFilterDialog;

import javax.swing.*;
import javax.swing.border.Border;
import java.awt.*;

/**
 * Created by IntelliJ IDEA.
 * User: Andrew
 * Date: 09.03.12
 * Time: 18:56
 * To change this template use File | Settings | File Templates.
 */
public class LinearFilterTable extends JTable {
    LinearFilterTableModel tableModel;
    UserFilterDialog parent;

    public LinearFilterTable(UserFilterDialog parent)
    {
        this.parent = parent;
        setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        setColumnSelectionAllowed(false);
        setRowSelectionAllowed(false);
        tableModel = new LinearFilterTableModel();
        setDefaultRenderer(Float.class, new LinearFilterTableRenderer(tableModel));

        setModel(tableModel);
        setSelectionForeground(Color.BLUE);        
        setDefaultEditor(Float.class, new LinearFilterTableCellEditor(tableModel));
       /* for (int i = 0; i < tableModel.getColumnCount(); i++)
        {
            getColumnModel().getColumn(i).setCellEditor(new LinearFilterTableCellEditor(tableModel));
        }*/


    }

    public LinearFilterTableModel getTableModel() {
        return tableModel;
    }
}
